<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ECSHOP 管理中心 - 商品列表 </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="${pageContext.request.contextPath}/Styles/general.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/Styles/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>
    <span class="action-span"><a href="${pageContext.request.contextPath}/jsp2/goodsAdd.jsp">添加新商品</a></span>
    <span class="action-span1"><a href="__GROUP__">ECSHOP 管理中心</a></span>
    <span id="search_id" class="action-span1"> - 商品列表 </span>
    <div style="clear:both"></div>
</h1>
<div class="form-div">
    <form action="" name="searchForm">
        <img src="${pageContext.request.contextPath}/img/icon_search.gif" width="26" height="22" border="0" alt="search" />
        <!-- 分类 -->
        <select name="cat_id">
            <option value="0">所有分类</option>
            <foreach name="cat_list" item="val">
            <option value="<{$val.cat_id}>"><{$val.lev|str_repeat='&nbsp;&nbsp;',###}><{$val.cat_name}></option>
            </foreach>
        </select>
        <!-- 品牌 -->
        <select name="brand_id">
            <option value="0">所有品牌</option>
            <foreach name="brand_list" item="val">
            <option value="<{$val.brand_id}>"><{$val.brand_name}></option>
            </foreach>
        </select>
        <!-- 推荐 -->
        <select name="intro_type">
            <option value="0">全部</option>
            <option value="is_best">精品</option>
            <option value="is_new">新品</option>
            <option value="is_hot">热销</option>
        </select>
        <!-- 上架 -->
        <select name="is_on_sale">
            <option value=''>全部</option>
            <option value="1">上架</option>
            <option value="0">下架</option>
        </select>
        <!-- 关键字 -->
        关键字 <input type="text" name="keyword" size="15" />
        <input type="submit" value=" 搜索 " class="button" />
    </form>
</div>

<!-- 商品列表 -->
<form method="post" action="" name="listForm" onsubmit="">
    <div class="list-div" id="listDiv">
        <table cellpadding="3" cellspacing="1">
            <tr>
                <th>商品id</th>
                <th>商品名称</th>
                <th>本店价格</th>
                <th>商品数量</th>
                <th>商品分类</th>
                <th>品牌</th>
                <th>是否上架</th>
                <th>是否卖出</th>
                <th>是否推荐</th>
                <!-- <th>图片</th> -->
                <th>操作</th>
            </tr>
            <c:forEach items="${list }" var="list">
	            <tr>
	                <td align="center">${list.g_id}</td>
	                <td align="center" class="first-cell">${list.g_name}</td>
	                <td align="center">${list.price}</td>
	                <td align="center">${list.numbers}</td>
	                <td align="center">${list.caterage.c_name}</td>
	                <td align="center">${list.brand.b_name}</td>
	                <c:if test="${list.is_on ==1}">
	                	<td align="center">上架</td>
	                </c:if>
	                <c:if test="${list.is_on ==0}">
	                	<td align="center">下架</td>
	                </c:if>
	                <c:if test="${list.is_on_sale !=0}">
	                	<td align="center">已卖出</td>
	                </c:if>
	                <c:if test="${list.is_on_sale ==0}">
	                	<td align="center">未卖出</td>
	                </c:if>
	                <td align="center">${list.is_on_push}</td>
	                <%-- <td align="center"><span><img src="${pageContext.request.contextPath}/upload/${list.g_pic}"/></span></td> --%>
	                <td align="center">
		                <a href="${pageContext.request.contextPath}/GoodsSelOne.do?id=${list.g_id}" >修改</a>
		                <a href="${pageContext.request.contextPath}/GoodsDele.do?id=${list.g_id}">删除</a>
	                </td>
	            </tr>
           </c:forEach>
        </table>

    <!-- 分页开始 -->
        <table id="page-table" cellspacing="0">
            <tr>
                <td align="right" nowrap="true" colspan="6">
                    <div id="turn-page">
				                        总计 <span id="totalRecords">${size}</span>
				                        个记录分为 <span id="totalPages">${totalSize+1}</span>
				                        页当前第 <span id="pageCurrent">${page+1}</span>
				                        页
                        <span id="page-link">
                            <a href="${pageContext.request.contextPath}/GoodsSel.do?currentPage=0">首页</a>
                            <a href="${pageContext.request.contextPath}/GoodsSel.do?currentPage=${page-1<0?0:page-1}">上一页</a>
                            <a href="${pageContext.request.contextPath}/GoodsSel.do?currentPage=${page+1>totalSize?totalSize:page+1}">下一页</a>
                            <a href="${pageContext.request.contextPath}/GoodsSel.do?currentPage=${totalSize}">尾页</a>
                        </span>
                    </div>
                </td>
            </tr>
        </table>
    <!-- 分页结束 -->
    </div>
</form>

<div id="footer">
共执行 7 个查询，用时 0.028849 秒，Gzip 已禁用，内存占用 3.219 MB<br />
版权所有 &copy; 2005-2012 上海商派网络科技有限公司，并保留所有权利。</div>
</body>
</html>